<html>
    <head>
        <meta charset="UTF-8">
        <title>宏定义使用</title>
    </head>

    <body>
        <#--定义一个宏，其中名称为img-->
        <#macro m a b ext...>
            a = ${a}
            b = ${b}
            <#if ext?is_sequence>
                <#list ext as e >
                    ${e_index} = ${e}
                </#list>
            <#elseif ext?is_hash>
                <#list ext?keys as e >
                    ${e} = ${ext[e]}
                </#list>
            </#if>
        </#macro>

        <!--调用-->
        <@m 1 2 3 4 5 6 7 />

        <@m a=1 b=2 c=3 d=4 e=5 f=6 g=7 />
    </body>

</html>